/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ejemjtree;

import javax.swing.tree.DefaultMutableTreeNode;

//se crea clase rama que agregará los datos del String al arbol
class Rama {
    DefaultMutableTreeNode r;
    public Rama( String datos[] ) {
        r = new DefaultMutableTreeNode( datos[0] );
        System.out.print ( "Agregando " + datos[0] + ": " );
        for ( int i=1; i < datos.length; i++ ) {
            r.add( new DefaultMutableTreeNode( datos[i] ) );
            System.out.print ( " " + datos[i] );
        }
        System.out.print ( "\n" );
    }

    public DefaultMutableTreeNode node() {
        return( r );
    }
}